﻿@{
    Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Promising通用权限管理系统</title>
    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/themes/default.css")" />
    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/themes/default/easyui.css")" />
    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/themes/icon.css")" />
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery-1.6.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.easyui.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/locale/easyui-lang-zh_CN.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/outlook2.js")"> </script>
    <script type="text/javascript">
        @*var _menus = { "menus": [
						{ "menuid": "1", "icon": "icon-manager", "menuname": "系统管理",
						    "menus": [
                                    { "menuid": "12", "menuname": "组织架构", "icon": "icon-organize", "url": "@Url.Action("Organize", "Organize")" },
                                    { "menuid": "13", "menuname": "用户管理", "icon": "icon-role", "url": "@Url.Action("Index", "User")" },
									{ "menuid": "16", "menuname": "数据字典", "icon": "icon-log", "url": "demo1.html" }
								]
						}
                        , { "menuid": "8", "icon": "icon-users", "menuname": "项目管理",
                            "menus": [{ "menuid": "21", "menuname": "新建流程", "icon": "icon-nav", "url": "demo.html" }
								]
                        }
				]

        };*@
              
        var _menus =  eval("(@ViewBag.CurrentUser.MenuPermission)".replace(/&quot;/g,"'"));
       
        //关闭登录窗口
        function closePwd() {
            $('#w').window('close');
        }



        //修改密码
        function showChangePasswordWin() {
            $('#winPassword').window('open');
        }

        function changePassword() {
            var oldPassword = $("#iptOldPassword").val();
            if (oldPassword == "") {
                $.messager.alert('提示', '请输入旧密码！','warning');
                return;
            }

            var password = $("#iptPassword").val();
            if (password == "") {
                $.messager.alert('提示', '请输入新密码！','warning');
                return;
            }

            var newPassword = $("#iptNewPassword").val();
            if (newPassword == "") {
                $.messager.alert('提示', '请确认密码！','warning');
                return;
            }

            if (newPassword != password) {
                $.messager.alert('提示', '两次密码不一致，请重新输入！','warning');
                return;
            }
            var parm = { password: password, oldPassword: oldPassword };
            $.ajax({
                type: "POST",
                url: "/Home/ChangedPassword/",
                data: parm,
                success: function (msg) {
                    if (msg.IsSuccess) {
                        $.messager.alert('提示', '修改成功！', "info", function () {
                            $('#winPassword').window('close');
                            $("#iptOldPassword").val("");
                            $("#iptPassword").val("");
                            $("#iptNewPassword").val("");
                        });
                    } else {
                        $.messager.alert('提示', '密码错误，请重新输入！', "info");
                    }
                },
                error: function () {
                    $.messager.alert('错误', '修改失败！', "error");
                }
            });
        }

        $(function () {
        
            $('#editpass').click(function () {
               showChangePasswordWin();
            });

            $('#btnEp').click(function () {
                serverLogin();
            })

            $('#btnCancel').click(function () { closePwd(); })

            $('#loginOut').click(function () {
                $.messager.confirm('系统提示', '您确定要退出本次登录吗?', function (r) {

                    if (r) {
                        location.href = '@Url.Action("LogOut", "Home")';
                    }
                });
            });

            //禁止右键
            document.oncontextmenu = function(){ return false; }
        });
		
		

    </script>
</head>
<body class="easyui-layout" style="overflow-y: hidden" scroll="no">
    <noscript>
        <div style="position: absolute; z-index: 100000; height: 2046px; top: 0px; left: 0px;
            width: 100%; background: white; text-align: center;">
            <img src="@Url.Content("~/Content/images/noscript.gif")" alt='抱歉，请开启脚本支持！' />
        </div>
    </noscript>
    <div region="north" split="true" border="false" style="overflow: hidden; height: 30px;
        background: #7f99be repeat-x center 50%;
        line-height: 20px; color: #fff; font-family: Verdana, 微软雅黑,黑体">
        <span style="float: right; padding-right: 20px;" class="head">
        欢迎您 @ViewBag.CurrentUser.UserInfo.UserName
        &nbsp; &nbsp;
         <a href="#" id="editpass">
            修改密码</a> <a href="#" id="loginOut">安全退出</a></span> <span style="padding-left: 10px;
                font-size: 16px;">
                <img src="@Url.Content("~/Content/images/blocks.gif")" width="20" height="20" align="absmiddle" />
                Promising通用权限管理系统</span>
    </div>
    <div region="south" split="true" style="height: 30px; background: #D2E0F2;">
        <div class="footer">
            Author:陈震 &nbsp; QQ:181330065 &nbsp; Emal:fq_chenzhen@126.com</div>
    </div>
    <div region="west" hide="true" split="true" title="导航菜单" style="width: 180px;" id="west">
        <div id="nav" class="easyui-accordion" fit="true" border="false">
            <!--  导航内容 -->
        </div>
    </div>
    <div id="mainPanle" region="center" style="background: #eee; overflow-y: hidden;">
        <div id="tabs" class="easyui-tabs" fit="true" border="false">
            <div title="欢迎使用" iconcls="tabs-icon icon icon-home" style="padding: 20px; overflow: hidden;">
                <h1>
                    欢迎使用 Promising 通用管理系统</h1>
                <table width="98%" border="0" cellpadding="3" align="center" cellspacing="0" bgcolor="#F1EAE0">
                    <tr>
                        <td width="100%" bgcolor="#cccccc" height="5">
                        </td>
                    </tr>
                    <tr>
                        <td width="100%" class="change_td" style="cursor: hand">
                            服务器参数
                        </td>
                    </tr>
                </table>
                <table cellspacing="1" cellpadding="3" width="98%" align="center" bgcolor="#ffffff"
                    border="0">
                    <tbody>
                        <tr>
                            <td class="th1" align="center" colspan="2" style="height: 25px">
                                服务器信息统计
                            </td>
                        </tr>
                        <tr bgcolor="#f9fbf0">
                            <td width="50%" style="height: 24px">
                                &nbsp;<strong>服务器名</strong>：@System.Environment.MachineName
                            </td>
                            <td width="50%" style="height: 24px">
                                &nbsp;<b>服务器端口：</b>@HttpContext.Current.Request.ServerVariables["Server_Port"].ToString()
                            </td>
                        </tr>
                        <tr bgcolor="#f9fbf0">
                            <td width="50%" style="height: 23px">
                                &nbsp;<b>脚本解释引擎：</b>@System.Environment.Version
                            </td>
                            <td width="50%" style="height: 23px">
                                <b>&nbsp;站点物理路径：</b>@HttpContext.Current.Request.PhysicalApplicationPath.ToString()
                            </td>
                        </tr>
                        <tr bgcolor="#f9fbf0">
                            <td width="50%" style="height: 23px">
                                &nbsp;<b>服务器CPU个数：</b>@System.Environment.ProcessorCount
                            </td>
                            <td width="50%" style="height: 23px">
                                &nbsp;<b>服务器IIS版本：</b>@HttpContext.Current.Request.ServerVariables["SERVER_SOFTWARE"]
                            </td>
                        </tr>
                        <tr bgcolor="#f9fbf0">
                            <td width="50%">
                                &nbsp;<b>开机运行时长：</b>@((System.Environment.TickCount / 3600000).ToString("N2"))
                                小时
                            </td>
                            <td width="50%">
                                <b>&nbsp;服务器时间：</b>@DateTime.Now.ToString()
                            </td>
                        </tr>
                        <tr bgcolor="#f9fbf0">
                            <td colspan="2">
                                &nbsp;<b>服务器操作系统：</b><span> @System.Environment.OSVersion.ToString()</span>
                            </td>
                        </tr>
                        <tr bgcolor="#f9fbf0">
                            <td colspan="2">
                                &nbsp;
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <!--修改密码窗口-->
    <div id="winPassword" class="easyui-window" closed="true" modal="true" title="修改密码"
        style="width: 280px; height: 160px;" collapsible="false" minimizable="false"
        maximizable="false">
        <div class="easyui-layout" fit="true">
            <div region="center" border="false" style="padding: 10px; background: #fff; border: 1px solid #ccc;">
                <table>
                    <tr>
                        <td>
                            旧密码：
                        </td>
                        <td>
                            <input type="password" id="iptOldPassword" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            新密码：
                        </td>
                        <td>
                            <input type="password" id="iptPassword" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            确认密码：
                        </td>
                        <td>
                            <input type="password" id="iptNewPassword" />
                        </td>
                    </tr>
                </table>
            </div>
            <div region="south" border="false" style="text-align: right; height: 30px; line-height: 30px;">
                <a class="easyui-linkbutton" iconcls="icon-ok" href="javascript:void(0)" onclick="changePassword()">
                    确定</a> <a class="easyui-linkbutton" iconcls="icon-cancel" href="javascript:void(0)"
                        onclick="$('#winPassword').window('close');">取消</a>
            </div>
        </div>
    </div>
    <div id="mm" class="easyui-menu" style="width: 150px;">
        <div id="mm-tabupdate">
            刷新</div>
        <div class="menu-sep">
        </div>
        <div id="mm-tabclose">
            关闭</div>
        <div id="mm-tabcloseall">
            全部关闭</div>
        <div id="mm-tabcloseother">
            除此之外全部关闭</div>
        <div class="menu-sep">
        </div>
        <div id="mm-tabcloseright">
            当前页右侧全部关闭</div>
        <div id="mm-tabcloseleft">
            当前页左侧全部关闭</div>
        <div class="menu-sep">
        </div>
        <div id="mm-exit">
            退出</div>
    </div>
</body>
</html>
